// Criterion requires the second argument to be by reference
#![allow(clippy::trivially_copy_pass_by_ref)]

use criterion::{black_box, Bencher};
use curve25519_donna::curve25519::verify;

const CURVE25519_PUBKEY_OUT_CORRECT: [u8; 32] = [
    0x59, 0x95, 0xf4, 0x64, 0xe9, 0xd3, 0x4d, 0x5c, 0xa5, 0x6b, 0x99, 0x05, 0xb9, 0xa3, 0xcc, 0x37,
    0xc4, 0x56, 0xb2, 0xd8, 0xd3, 0x13, 0xed, 0xbc, 0xf5, 0x84, 0xb7, 0x05, 0xb5, 0xc0, 0x49, 0x55,
];

const CURVE25519_SIGNATURE_OUT_CORRECT: [u8; 64] = [
    0xcf, 0x87, 0x3d, 0x03, 0x79, 0xac, 0x20, 0xe8, 0x89, 0x3e, 0x55, 0x67, 0xee, 0x0f, 0x89, 0x51,
    0xf8, 0xdb, 0x84, 0x0d, 0x26, 0xb2, 0x43, 0xb4, 0x63, 0x52, 0x66, 0x89, 0xd0, 0x1c, 0xa7, 0x18,
    0xac, 0x18, 0x9f, 0xb1, 0x67, 0x85, 0x74, 0xeb, 0xdd, 0xe5, 0x69, 0x33, 0x06, 0x59, 0x44, 0x8b,
    0x0b, 0xd6, 0xc1, 0x97, 0x3f, 0x7d, 0x78, 0x0a, 0xb3, 0x95, 0x18, 0x62, 0x68, 0x03, 0xd7, 0x82,
];

const CURVE25519_MESSAGE: [u8; 200] = [0u8; 200];

pub fn curve25519_donna_verify(bench: &mut Bencher, _i: &()) {
    bench.iter(|| {
        black_box(verify(
            black_box(&CURVE25519_SIGNATURE_OUT_CORRECT),
            black_box(&CURVE25519_PUBKEY_OUT_CORRECT),
            black_box(&CURVE25519_MESSAGE),
        ))
    });
}
